home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 1990: Night of the Living Disc / Night of the Living Disc.2mg / Dev.CD.5 / Tools / DTS.Samples / SC09Lister / Utils.c < prev   
Encoding:
C/C++ Source or Header  |  1990-04-03  |  577 b   |  29 lines  |  [B0] Apple IIgs Source Code (0x000A)

  1. #define BASE 10
  2.  
  3. /**********************************************************************/
  4.  
  5. /* This is too obvious to bother commenting. */
  6.  
  7. unsigned int    appendi2pstr(pstr, i)
  8. char            *pstr;
  9. unsigned int    i;
  10. {
  11.     unsigned int    j;
  12.  
  13.     j = 0;
  14.     if (i >= BASE) j = appendi2pstr(pstr, i / BASE);
  15.     pstr[++*pstr] = "0123456789ABCDEF"[i - j];
  16.     return(BASE * i);
  17. }
  18.  
  19. /**********************************************************************/
  20.  
  21. void            i2pstr(pstr, i)
  22. char            *pstr;
  23. unsigned int    i;
  24. {
  25.     *pstr = 0;
  26.     appendi2pstr(pstr, i);
  27. }
  28.  
  29.